# 序列相加
l = [1, 2, 3] + [4, 5, 6]
print(l)

l2 = 'Hello,' + 'world!'
print(l2)

# 乘法
l = [1, 2, 3] * 3
print(l)  # [1, 2, 3, 1, 2, 3, 1, 2, 3]

l2 = 'python' * 5
print(l2)  # pythonpythonpythonpythonpython

#
l0 = []
print(l0)  # []

l10 = [0] * 10
print(l10)  # [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]

l10None = [None] * 10
print(l10None)  # [None, None, None, None, None, None, None, None, None, None]

#
sentence = "nnnnf"
sentence = "nnnnf"

sentence = "zhongwen has problem"
padding = 10
sentence_length = len(sentence)
top = '+' + '-' * (padding * 2 + sentence_length) + '+'
top2 = '|' + ' ' * (len(top) - 2) + '|'
mid = '|' + ' ' * padding + sentence + ' ' * padding + "|"
print(top)
print(top2)
print(mid)
print(top2)
print(top)
#
# +----------------------------------------+
# |                                        |
# |          zhongwen has problem          |
# |                                        |
# +----------------------------------------+
#

#
permissions = 'rw'
print('w' in permissions)  # True

users = ['mlh', 'foo', 'bar']
print('ap' in users)  # False

subject = '$$$ Get rich now!!! $$$'
print('$$$' in subject)  # True

#
database = [
    ['albert', '1234'],
    ['dilbert', '4242'],
    ['smith', '7524'],
    ['jones', '9843']
]
username = 'dilbert'
password = '4242'
if [username, password] in database:
    print("Access Allow")
else:
    print("Access Forbbiden")

#
numbers = [100, 34, 678]
print(len(numbers), max(numbers), min(numbers))  # 3 678 34

#
